package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

@Mapper
public interface UserMapper {
    /**
     * 用户登录
     * @param openid
     * @return
     */
    @Select("select * from user where openid=#{openid} ")
    User getByOPenid(String openid);
    /**
     * 自动注册 插入数据
     * @param user
     */
    void insert(User user);

@Select("select  *from user where id=#{id}")
    User getById(Long userId);
}
